﻿Imports System.Data.SqlClient
Imports MySql.Data.MySqlClient

Public Class frmnganhang
    Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnNew As System.Windows.Forms.Button
    Friend WithEvents btnSave As System.Windows.Forms.Button
    Friend WithEvents btnDelete1 As System.Windows.Forms.Button
    Friend WithEvents BtnClose As System.Windows.Forms.Button
    Friend WithEvents TxtGchu As System.Windows.Forms.TextBox
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents TxtTKU As System.Windows.Forms.TextBox
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents TxtTKV As System.Windows.Forms.TextBox
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents TxtFax As System.Windows.Forms.TextBox
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents TxtDT As System.Windows.Forms.TextBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents TxtLL As System.Windows.Forms.TextBox
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents TxtGD As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents txtDiachi As System.Windows.Forms.TextBox
    Friend WithEvents txtTen_NH As System.Windows.Forms.TextBox
    Friend WithEvents txtMa_NH As System.Windows.Forms.TextBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
    Friend WithEvents TblnganhangBindingSource As System.Windows.Forms.BindingSource
    Friend WithEvents DataSetForm_Don As NHANSINH.DataSetForm_Don
    Friend WithEvents Label15 As System.Windows.Forms.Label
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents Label13 As System.Windows.Forms.Label
    Friend WithEvents Label14 As System.Windows.Forms.Label
    Friend WithEvents Label16 As System.Windows.Forms.Label
    Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn2 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn3 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn4 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn5 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn6 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn7 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn8 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn9 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn10 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents LblRecords As System.Windows.Forms.Label
    Friend WithEvents Button1 As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmnganhang))
        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Me.btnSave = New System.Windows.Forms.Button
        Me.btnNew = New System.Windows.Forms.Button
        Me.btnDelete1 = New System.Windows.Forms.Button
        Me.BtnClose = New System.Windows.Forms.Button
        Me.Button1 = New System.Windows.Forms.Button
        Me.TxtGchu = New System.Windows.Forms.TextBox
        Me.Label11 = New System.Windows.Forms.Label
        Me.TxtTKU = New System.Windows.Forms.TextBox
        Me.Label10 = New System.Windows.Forms.Label
        Me.TxtTKV = New System.Windows.Forms.TextBox
        Me.Label9 = New System.Windows.Forms.Label
        Me.TxtFax = New System.Windows.Forms.TextBox
        Me.Label8 = New System.Windows.Forms.Label
        Me.TxtDT = New System.Windows.Forms.TextBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.TxtLL = New System.Windows.Forms.TextBox
        Me.Label6 = New System.Windows.Forms.Label
        Me.TxtGD = New System.Windows.Forms.TextBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.txtDiachi = New System.Windows.Forms.TextBox
        Me.txtTen_NH = New System.Windows.Forms.TextBox
        Me.txtMa_NH = New System.Windows.Forms.TextBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label1 = New System.Windows.Forms.Label
        Me.DataGridView1 = New System.Windows.Forms.DataGridView
        Me.TblnganhangBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        Me.DataSetForm_Don = New NHANSINH.DataSetForm_Don
        Me.Label15 = New System.Windows.Forms.Label
        Me.Label12 = New System.Windows.Forms.Label
        Me.Label13 = New System.Windows.Forms.Label
        Me.Label14 = New System.Windows.Forms.Label
        Me.Label16 = New System.Windows.Forms.Label
        Me.LblRecords = New System.Windows.Forms.Label
        Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn4 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn5 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn6 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn7 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn8 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn9 = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataGridViewTextBoxColumn10 = New System.Windows.Forms.DataGridViewTextBoxColumn
        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.TblnganhangBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataSetForm_Don, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'btnSave
        '
        Me.btnSave.BackColor = System.Drawing.Color.Transparent
        Me.btnSave.Image = CType(resources.GetObject("btnSave.Image"), System.Drawing.Image)
        Me.btnSave.Location = New System.Drawing.Point(231, 190)
        Me.btnSave.Name = "btnSave"
        Me.btnSave.Size = New System.Drawing.Size(96, 24)
        Me.btnSave.TabIndex = 10
        Me.btnSave.UseVisualStyleBackColor = False
        '
        'btnNew
        '
        Me.btnNew.Image = CType(resources.GetObject("btnNew.Image"), System.Drawing.Image)
        Me.btnNew.Location = New System.Drawing.Point(111, 190)
        Me.btnNew.Name = "btnNew"
        Me.btnNew.Size = New System.Drawing.Size(96, 24)
        Me.btnNew.TabIndex = 11
        '
        'btnDelete1
        '
        Me.btnDelete1.Image = CType(resources.GetObject("btnDelete1.Image"), System.Drawing.Image)
        Me.btnDelete1.Location = New System.Drawing.Point(351, 190)
        Me.btnDelete1.Name = "btnDelete1"
        Me.btnDelete1.Size = New System.Drawing.Size(88, 24)
        Me.btnDelete1.TabIndex = 29
        '
        'BtnClose
        '
        Me.BtnClose.Image = CType(resources.GetObject("BtnClose.Image"), System.Drawing.Image)
        Me.BtnClose.Location = New System.Drawing.Point(583, 190)
        Me.BtnClose.Name = "BtnClose"
        Me.BtnClose.Size = New System.Drawing.Size(88, 24)
        Me.BtnClose.TabIndex = 30
        '
        'Button1
        '
        Me.Button1.Image = CType(resources.GetObject("Button1.Image"), System.Drawing.Image)
        Me.Button1.Location = New System.Drawing.Point(471, 190)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(88, 24)
        Me.Button1.TabIndex = 39
        '
        'TxtGchu
        '
        Me.TxtGchu.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtGchu.Location = New System.Drawing.Point(113, 158)
        Me.TxtGchu.MaxLength = 300
        Me.TxtGchu.Name = "TxtGchu"
        Me.TxtGchu.Size = New System.Drawing.Size(576, 22)
        Me.TxtGchu.TabIndex = 9
        '
        'Label11
        '
        Me.Label11.Location = New System.Drawing.Point(59, 158)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(54, 19)
        Me.Label11.TabIndex = 75
        Me.Label11.Text = "Ghi chú"
        Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'TxtTKU
        '
        Me.TxtTKU.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtTKU.Location = New System.Drawing.Point(545, 129)
        Me.TxtTKU.MaxLength = 20
        Me.TxtTKU.Name = "TxtTKU"
        Me.TxtTKU.Size = New System.Drawing.Size(144, 22)
        Me.TxtTKU.TabIndex = 8
        '
        'Label10
        '
        Me.Label10.Location = New System.Drawing.Point(486, 134)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(58, 16)
        Me.Label10.TabIndex = 74
        Me.Label10.Text = "TK USD"
        '
        'TxtTKV
        '
        Me.TxtTKV.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtTKV.Location = New System.Drawing.Point(338, 130)
        Me.TxtTKV.MaxLength = 20
        Me.TxtTKV.Name = "TxtTKV"
        Me.TxtTKV.Size = New System.Drawing.Size(144, 22)
        Me.TxtTKV.TabIndex = 7
        '
        'Label9
        '
        Me.Label9.Location = New System.Drawing.Point(257, 134)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(76, 16)
        Me.Label9.TabIndex = 73
        Me.Label9.Text = "TK VND"
        '
        'TxtFax
        '
        Me.TxtFax.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtFax.Location = New System.Drawing.Point(113, 132)
        Me.TxtFax.MaxLength = 20
        Me.TxtFax.Name = "TxtFax"
        Me.TxtFax.Size = New System.Drawing.Size(144, 22)
        Me.TxtFax.TabIndex = 6
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(59, 134)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(57, 16)
        Me.Label8.TabIndex = 72
        Me.Label8.Text = "Fax"
        Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'TxtDT
        '
        Me.TxtDT.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtDT.Location = New System.Drawing.Point(545, 102)
        Me.TxtDT.MaxLength = 20
        Me.TxtDT.Name = "TxtDT"
        Me.TxtDT.Size = New System.Drawing.Size(144, 22)
        Me.TxtDT.TabIndex = 5
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(486, 106)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(57, 16)
        Me.Label7.TabIndex = 71
        Me.Label7.Text = "Điện thoại"
        '
        'TxtLL
        '
        Me.TxtLL.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtLL.Location = New System.Drawing.Point(338, 102)
        Me.TxtLL.MaxLength = 100
        Me.TxtLL.Name = "TxtLL"
        Me.TxtLL.Size = New System.Drawing.Size(144, 22)
        Me.TxtLL.TabIndex = 4
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(257, 106)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(74, 16)
        Me.Label6.TabIndex = 70
        Me.Label6.Text = "Người liên lạc"
        '
        'TxtGD
        '
        Me.TxtGD.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtGD.Location = New System.Drawing.Point(113, 104)
        Me.TxtGD.MaxLength = 150
        Me.TxtGD.Name = "TxtGD"
        Me.TxtGD.Size = New System.Drawing.Size(144, 22)
        Me.TxtGD.TabIndex = 3
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(59, 106)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(57, 16)
        Me.Label5.TabIndex = 69
        Me.Label5.Text = "Tên GD"
        Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'txtDiachi
        '
        Me.txtDiachi.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtDiachi.Location = New System.Drawing.Point(113, 76)
        Me.txtDiachi.MaxLength = 200
        Me.txtDiachi.Name = "txtDiachi"
        Me.txtDiachi.Size = New System.Drawing.Size(576, 22)
        Me.txtDiachi.TabIndex = 2
        '
        'txtTen_NH
        '
        Me.txtTen_NH.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtTen_NH.Location = New System.Drawing.Point(313, 50)
        Me.txtTen_NH.MaxLength = 150
        Me.txtTen_NH.Name = "txtTen_NH"
        Me.txtTen_NH.Size = New System.Drawing.Size(376, 22)
        Me.txtTen_NH.TabIndex = 1
        '
        'txtMa_NH
        '
        Me.txtMa_NH.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtMa_NH.Location = New System.Drawing.Point(113, 50)
        Me.txtMa_NH.MaxLength = 20
        Me.txtMa_NH.Name = "txtMa_NH"
        Me.txtMa_NH.Size = New System.Drawing.Size(144, 22)
        Me.txtMa_NH.TabIndex = 0
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(59, 76)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(54, 19)
        Me.Label4.TabIndex = 67
        Me.Label4.Text = "Địa chỉ"
        Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(257, 52)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(48, 16)
        Me.Label3.TabIndex = 66
        Me.Label3.Text = "Tên NH"
        Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(59, 52)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(57, 16)
        Me.Label2.TabIndex = 65
        Me.Label2.Text = "Mã NH"
        Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.Color.Transparent
        Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(239, 11)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(304, 24)
        Me.Label1.TabIndex = 64
        Me.Label1.Text = "DANH MỤC NGÂN HÀNG"
        '
        'DataGridView1
        '
        Me.DataGridView1.AllowUserToAddRows = False
        Me.DataGridView1.AllowUserToDeleteRows = False
        Me.DataGridView1.AllowUserToResizeColumns = False
        Me.DataGridView1.AutoGenerateColumns = False
        Me.DataGridView1.BackgroundColor = System.Drawing.Color.LightBlue
        DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control
        DataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText
        DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight
        DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText
        DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
        Me.DataGridView1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
        Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1, Me.DataGridViewTextBoxColumn2, Me.DataGridViewTextBoxColumn3, Me.DataGridViewTextBoxColumn4, Me.DataGridViewTextBoxColumn5, Me.DataGridViewTextBoxColumn6, Me.DataGridViewTextBoxColumn7, Me.DataGridViewTextBoxColumn8, Me.DataGridViewTextBoxColumn9, Me.DataGridViewTextBoxColumn10})
        Me.DataGridView1.DataSource = Me.TblnganhangBindingSource
        Me.DataGridView1.Location = New System.Drawing.Point(12, 240)
        Me.DataGridView1.Name = "DataGridView1"
        Me.DataGridView1.ReadOnly = True
        Me.DataGridView1.RowHeadersWidth = 30
        Me.DataGridView1.Size = New System.Drawing.Size(768, 321)
        Me.DataGridView1.TabIndex = 76
        '
        'TblnganhangBindingSource
        '
        Me.TblnganhangBindingSource.DataMember = "tbl_nganhang"
        Me.TblnganhangBindingSource.DataSource = Me.DataSetForm_Don
        '
        'DataSetForm_Don
        '
        Me.DataSetForm_Don.DataSetName = "DataSetForm_Don"
        Me.DataSetForm_Don.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'Label15
        '
        Me.Label15.AutoSize = True
        Me.Label15.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label15.ForeColor = System.Drawing.Color.DarkGreen
        Me.Label15.Location = New System.Drawing.Point(505, 218)
        Me.Label15.Name = "Label15"
        Me.Label15.Size = New System.Drawing.Size(32, 13)
        Me.Label15.TabIndex = 1074
        Me.Label15.Text = "Ctrl-P"
        Me.Label15.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label12
        '
        Me.Label12.AutoSize = True
        Me.Label12.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label12.ForeColor = System.Drawing.Color.DarkGreen
        Me.Label12.Location = New System.Drawing.Point(146, 218)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(33, 13)
        Me.Label12.TabIndex = 1070
        Me.Label12.Text = "Ctrl-N"
        Me.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label13
        '
        Me.Label13.AutoSize = True
        Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label13.ForeColor = System.Drawing.Color.DarkGreen
        Me.Label13.Location = New System.Drawing.Point(262, 218)
        Me.Label13.Name = "Label13"
        Me.Label13.Size = New System.Drawing.Size(32, 13)
        Me.Label13.TabIndex = 1071
        Me.Label13.Text = "Ctrl-S"
        Me.Label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label14
        '
        Me.Label14.AutoSize = True
        Me.Label14.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label14.ForeColor = System.Drawing.Color.DarkGreen
        Me.Label14.Location = New System.Drawing.Point(612, 218)
        Me.Label14.Name = "Label14"
        Me.Label14.Size = New System.Drawing.Size(32, 13)
        Me.Label14.TabIndex = 1073
        Me.Label14.Text = "Ctrl-X"
        Me.Label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label16
        '
        Me.Label16.AutoSize = True
        Me.Label16.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label16.ForeColor = System.Drawing.Color.DarkGreen
        Me.Label16.Location = New System.Drawing.Point(377, 218)
        Me.Label16.Name = "Label16"
        Me.Label16.Size = New System.Drawing.Size(33, 13)
        Me.Label16.TabIndex = 1072
        Me.Label16.Text = "Ctrl-D"
        Me.Label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'LblRecords
        '
        Me.LblRecords.AutoSize = True
        Me.LblRecords.ForeColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer))
        Me.LblRecords.Location = New System.Drawing.Point(16, 222)
        Me.LblRecords.Name = "LblRecords"
        Me.LblRecords.Size = New System.Drawing.Size(45, 13)
        Me.LblRecords.TabIndex = 1118
        Me.LblRecords.Text = "Label18"
        Me.LblRecords.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'DataGridViewTextBoxColumn1
        '
        Me.DataGridViewTextBoxColumn1.DataPropertyName = "ma_nganhang"
        Me.DataGridViewTextBoxColumn1.HeaderText = "Mã NH"
        Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1"
        Me.DataGridViewTextBoxColumn1.ReadOnly = True
        Me.DataGridViewTextBoxColumn1.Width = 80
        '
        'DataGridViewTextBoxColumn2
        '
        Me.DataGridViewTextBoxColumn2.DataPropertyName = "ten_giaodich"
        Me.DataGridViewTextBoxColumn2.HeaderText = "Tên  giao dịch"
        Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2"
        Me.DataGridViewTextBoxColumn2.ReadOnly = True
        Me.DataGridViewTextBoxColumn2.Width = 180
        '
        'DataGridViewTextBoxColumn3
        '
        Me.DataGridViewTextBoxColumn3.DataPropertyName = "ten_nganhang"
        Me.DataGridViewTextBoxColumn3.HeaderText = "Tên NH"
        Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3"
        Me.DataGridViewTextBoxColumn3.ReadOnly = True
        Me.DataGridViewTextBoxColumn3.Width = 290
        '
        'DataGridViewTextBoxColumn4
        '
        Me.DataGridViewTextBoxColumn4.DataPropertyName = "diachi"
        Me.DataGridViewTextBoxColumn4.HeaderText = "dia chi"
        Me.DataGridViewTextBoxColumn4.Name = "DataGridViewTextBoxColumn4"
        Me.DataGridViewTextBoxColumn4.ReadOnly = True
        Me.DataGridViewTextBoxColumn4.Visible = False
        Me.DataGridViewTextBoxColumn4.Width = 250
        '
        'DataGridViewTextBoxColumn5
        '
        Me.DataGridViewTextBoxColumn5.DataPropertyName = "dienthoai"
        Me.DataGridViewTextBoxColumn5.HeaderText = "Điện thoại"
        Me.DataGridViewTextBoxColumn5.Name = "DataGridViewTextBoxColumn5"
        Me.DataGridViewTextBoxColumn5.ReadOnly = True
        Me.DataGridViewTextBoxColumn5.Width = 120
        '
        'DataGridViewTextBoxColumn6
        '
        Me.DataGridViewTextBoxColumn6.DataPropertyName = "fax"
        Me.DataGridViewTextBoxColumn6.HeaderText = "fax"
        Me.DataGridViewTextBoxColumn6.Name = "DataGridViewTextBoxColumn6"
        Me.DataGridViewTextBoxColumn6.ReadOnly = True
        Me.DataGridViewTextBoxColumn6.Visible = False
        Me.DataGridViewTextBoxColumn6.Width = 70
        '
        'DataGridViewTextBoxColumn7
        '
        Me.DataGridViewTextBoxColumn7.DataPropertyName = "so_taikhoanvnd"
        Me.DataGridViewTextBoxColumn7.HeaderText = "so_taikhoanvnd"
        Me.DataGridViewTextBoxColumn7.Name = "DataGridViewTextBoxColumn7"
        Me.DataGridViewTextBoxColumn7.ReadOnly = True
        Me.DataGridViewTextBoxColumn7.Visible = False
        '
        'DataGridViewTextBoxColumn8
        '
        Me.DataGridViewTextBoxColumn8.DataPropertyName = "so_taikhoanusd"
        Me.DataGridViewTextBoxColumn8.HeaderText = "so_taikhoanusd"
        Me.DataGridViewTextBoxColumn8.Name = "DataGridViewTextBoxColumn8"
        Me.DataGridViewTextBoxColumn8.ReadOnly = True
        Me.DataGridViewTextBoxColumn8.Visible = False
        '
        'DataGridViewTextBoxColumn9
        '
        Me.DataGridViewTextBoxColumn9.DataPropertyName = "nguoi_lienlac"
        Me.DataGridViewTextBoxColumn9.HeaderText = "nguoi_lienlac"
        Me.DataGridViewTextBoxColumn9.Name = "DataGridViewTextBoxColumn9"
        Me.DataGridViewTextBoxColumn9.ReadOnly = True
        Me.DataGridViewTextBoxColumn9.Visible = False
        Me.DataGridViewTextBoxColumn9.Width = 150
        '
        'DataGridViewTextBoxColumn10
        '
        Me.DataGridViewTextBoxColumn10.DataPropertyName = "ghichu"
        Me.DataGridViewTextBoxColumn10.HeaderText = "ghichu"
        Me.DataGridViewTextBoxColumn10.Name = "DataGridViewTextBoxColumn10"
        Me.DataGridViewTextBoxColumn10.ReadOnly = True
        Me.DataGridViewTextBoxColumn10.Visible = False
        '
        'frmnganhang
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.LightBlue
        Me.ClientSize = New System.Drawing.Size(792, 573)
        Me.ControlBox = False
        Me.Controls.Add(Me.LblRecords)
        Me.Controls.Add(Me.Label15)
        Me.Controls.Add(Me.Label12)
        Me.Controls.Add(Me.Label13)
        Me.Controls.Add(Me.Label14)
        Me.Controls.Add(Me.Label16)
        Me.Controls.Add(Me.DataGridView1)
        Me.Controls.Add(Me.TxtGchu)
        Me.Controls.Add(Me.Label11)
        Me.Controls.Add(Me.TxtTKU)
        Me.Controls.Add(Me.Label10)
        Me.Controls.Add(Me.TxtTKV)
        Me.Controls.Add(Me.Label9)
        Me.Controls.Add(Me.TxtFax)
        Me.Controls.Add(Me.Label8)
        Me.Controls.Add(Me.TxtDT)
        Me.Controls.Add(Me.Label7)
        Me.Controls.Add(Me.TxtLL)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.TxtGD)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.txtDiachi)
        Me.Controls.Add(Me.txtTen_NH)
        Me.Controls.Add(Me.txtMa_NH)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.BtnClose)
        Me.Controls.Add(Me.btnDelete1)
        Me.Controls.Add(Me.btnNew)
        Me.Controls.Add(Me.btnSave)
        Me.Name = "frmnganhang"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "  Danh Muc Ngan Hang"
        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.TblnganhangBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataSetForm_Don, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region
    Dim myDT As New DataTable
    Dim strError As String = ""
    Dim myform As Form
    Dim sqlQuery As String = ""
    Sub SetclearData()
        txtMa_NH.Text = ""
        txtTen_NH.Text = ""
        txtDiachi.Text = ""
        TxtGD.Text = ""
        TxtLL.Text = ""
        TxtDT.Text = ""
        TxtFax.Text = ""
        TxtTKV.Text = ""
        TxtTKU.Text = ""
        TxtGchu.Text = ""
    End Sub
    Private Sub frmnganhang_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        'tao moi
        If e.KeyCode = (e.Control And Keys.N) Then
            SetclearData()
            txtMa_NH.Focus()
        End If
        'Luu
        If e.KeyCode = (e.Control And Keys.S) Then
            luu()
        End If
        'Xoa
        If e.KeyCode = (e.Control And Keys.D) Then
            xoa()
        End If
        'Thoat
        If e.KeyCode = (e.Control And Keys.Q) Then
            Me.Close()
        End If
        If e.KeyCode = (e.Control And Keys.P) Then
            FrmCrNganHang.Show()
        End If
    End Sub
    Private Sub txtMa_NH_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtMa_NH.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtTen_NH.Focus()
        End If
    End Sub

    Private Sub txtTen_NH_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtTen_NH.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtDiachi.Focus()
        End If
    End Sub
    Private Sub txtDiachi_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtDiachi.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtGD.Focus()
        End If
    End Sub
    Private Sub TxtGD_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtGD.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtLL.Focus()
        End If
    End Sub
    Private Sub TxtLL_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtLL.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtDT.Focus()
        End If
    End Sub
    Private Sub TxtDT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtDT.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtFax.Focus()
        End If
    End Sub
    Private Sub TxtFax_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtFax.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtTKV.Focus()
        End If
    End Sub
    Private Sub TxtTKV_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtTKV.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtTKU.Focus()
        End If
    End Sub
    Private Sub TxtTKU_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtTKU.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtGchu.Focus()
        End If
    End Sub
    Private Sub TxtGchu_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtGchu.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.btnSave.Focus()
        End If
    End Sub
    Private Sub btnSave_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles btnSave.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.btnNew.Focus()
        End If
    End Sub
    Private Sub btnNew_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles btnNew.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtMa_NH.Focus()
        End If
    End Sub
    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        luu()
    End Sub
    Private Sub luu()
        ' Kiểm tra có nhập liệu chưa ?
        If Me.checkInput(txtMa_NH.Text, txtTen_NH.Text) Then
            Dim txtMaNH = Me.txtMa_NH.Text.Trim
            sqlQuery = "SELECT ma_nganhang FROM tbl_nganhang WHERE ma_nganhang  = '" & txtMaNH & "'"
            Dim existedMamon As Integer = moduleDatabaseConn.CheckRecordExisted(sqlQuery)
            If existedMamon = 1 Then ' Update record
                sqlQuery = "UPDATE tbl_nganhang  "
                sqlQuery += "SET "
                sqlQuery += "ma_nganhang  = '" & txtMaNH & "'"
                sqlQuery += ", ten_giaodich= '" & Me.TxtGD.Text.Trim & "'"
                sqlQuery += ", diachi= '" & Me.txtDiachi.Text.Trim & "'"
                sqlQuery += ", dienthoai= '" & Me.TxtDT.Text.Trim & "'"
                sqlQuery += ", Fax= '" & Me.TxtFax.Text.Trim & "'"
                sqlQuery += ", so_taikhoanvnd= '" & Me.TxtTKV.Text.Trim & "'"
                sqlQuery += ", so_taikhoanusd= '" & Me.TxtTKU.Text.Trim & "'"
                sqlQuery += ", nguoi_lienlac = '" & Me.TxtLL.Text.Trim & "'"
                sqlQuery += ", ghichu = '" & Me.TxtGchu.Text.Trim & "'"
                sqlQuery += " WHERE ma_nganhang = '" & txtMaNH & "'"
                Dim updated As Integer = moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                If updated = 1 Then
                    MessageBox.Show("Cập nhật thông tin thành công !")
                    Me.loadDanhSachNganhang()
                Else
                    MessageBox.Show("Cập nhật thông tin không thành công: " & globalVariale.sqlMsgError)
                End If

            Else
                If existedMamon = 0 Then ' Insert record
                    sqlQuery = "INSERT INTO tbl_nganhang "
                    sqlQuery += "(ma_nganhang, ten_giaodich,ten_nganhang,diachi,dienthoai,Fax,so_taikhoanvnd,so_taikhoanusd,nguoi_lienlac,ghichu) "
                    sqlQuery += "VALUES "
                    sqlQuery += "("
                    sqlQuery += "'" & txtMaNH.ToUpper & "', "
                    sqlQuery += "'" & Me.TxtGD.Text.Trim & "', "
                    sqlQuery += "'" & Me.txtTen_NH.Text.Trim & "', "
                    sqlQuery += "'" & Me.txtDiachi.Text.Trim & "', "
                    sqlQuery += "'" & Me.TxtDT.Text.Trim & "', "
                    sqlQuery += "'" & Me.TxtFax.Text.Trim & "', "
                    sqlQuery += "'" & Me.TxtTKV.Text.Trim & "', "
                    sqlQuery += "'" & Me.TxtTKU.Text.Trim & "', "
                    sqlQuery += "'" & Me.TxtLL.Text.Trim & "', "
                    sqlQuery += "'" & Me.TxtGchu.Text.Trim & "'"
                    sqlQuery += ")"
                    Dim inserted As Integer = moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                    If inserted = 1 Then
                        MessageBox.Show("Thêm thông tin thành công !")
                        Me.loadDanhSachNganhang()
                    Else
                        MessageBox.Show("Thêm thông tin không thành công: " & globalVariale.sqlMsgError)
                    End If
                Else ' SQLExeption: existedMaQuocGia = -1
                    MessageBox.Show("Lấy dữ liệu bị lỗi: " & globalVariale.sqlMsgError, "Lấy dữ liệu", MessageBoxButtons.OK, MessageBoxIcon.Warning)
                End If
            End If
        End If
    End Sub

    Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
        SetclearData()
        txtMa_NH.Focus()
    End Sub
    Private Sub btnDelete1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete1.Click
        xoa()
    End Sub
    Private Sub xoa()
        Dim txtMaNH As String = Trim(Me.txtMa_NH.Text)
        If txtMaNH = "" Then
            MessageBox.Show("Bạn chưa chọn Mã để xóa !")
        Else
            Dim txtTenNH As String = Trim(Me.txtTen_NH.Text)
            moduleConstants.MessageWarning = "Bạn có muốn xóa " & txtMaNH & "(" & txtTenNH & ") ?"

            If MessageBox.Show(moduleConstants.MessageWarning, globalVariale.msgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = MsgBoxResult.Yes Then
                Dim sqlQuery As String = "DELETE FROM tbl_nganhang WHERE ma_nganhang = '" & txtMaNH & "'"
                Dim deleting As Integer = moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                If deleting = 1 Then
                    MessageBox.Show("Xóa thông tin thành công !")
                    Me.loadDanhSachNganhang()
                    SetclearData()
                Else
                    MessageBox.Show("Xóa thông tin không thành công: " & globalVariale.sqlMsgError)
                End If
            End If
        End If
    End Sub
    Private Sub frmNganhang_load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        moduleUtils.setDinhDangVietNam()
        Me.KeyPreview = True
        Me.loadDanhSachNganhang()
    End Sub

    Private Sub BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClose.Click
        Me.Close()
    End Sub

    Function checkInput(ByVal ma As String, ByVal ten As String) As Boolean
        Dim result As Boolean = True
        If ma = "" Then
            MessageBox.Show("Bạn chưa chọn Mã Ngân hàng !")
            result = False
        Else
            If ten = "" Then
                MessageBox.Show("Bạn chưa nhập tên Ngân hàng !")
                result = False
            End If
        End If
        Return result
    End Function

    Private Sub loadDanhSachNganhang()
        sqlQuery = "SELECT * FROM tbl_nganhang"
        Me.DataGridView1.DataSource = moduleDatabaseConn.GetDataTable(sqlQuery)
        Me.LblRecords.Text = Me.DataGridView1.Rows.Count & " mẫu tin"
    End Sub

    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        Dim iRow As Integer = Me.DataGridView1.CurrentRow.Index
        Me.txtMa_NH.Text = Me.DataGridView1.Item(0, iRow).Value
        Me.TxtGD.Text = Me.DataGridView1.Item(1, iRow).Value
        Me.txtTen_NH.Text = Me.DataGridView1.Item(2, iRow).Value
        Me.txtDiachi.Text = Me.DataGridView1.Item(3, iRow).Value
        Me.TxtDT.Text = Me.DataGridView1.Item(4, iRow).Value
        Me.TxtFax.Text = Me.DataGridView1.Item(5, iRow).Value
        Me.TxtTKV.Text = Me.DataGridView1.Item(6, iRow).Value
        Me.TxtTKU.Text = Me.DataGridView1.Item(7, iRow).Value
        Me.TxtLL.Text = Me.DataGridView1.Item(8, iRow).Value
        Me.TxtGchu.Text = Me.DataGridView1.Item(9, iRow).Value
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        FrmCrNganHang.Show()
    End Sub
End Class


